using System;
using NHibernate.Validator.Constraints;
using SharpArch.Core.DomainModel;

namespace good1.Core
{
    public class ThirdPartyIdentity : Entity
    {
        private DateTime createdDate;

        public ThirdPartyIdentity()
        {
            if (createdDate < DateTime.Today.AddYears(-100)) createdDate = DateTime.Today;
        }
		
		[NotNull, NotEmpty]
		public virtual string ClaimedIdentifier { get; set; }

        public virtual bool Trusted { get; set; }
        //ALTER TABLE ThirdPartyIdentities ADD Trusted BIT NOT NULL CONSTRAINT NotTrustedByDefault DEFAULT 0 

        public virtual DateTime CreatedDate { get { 
            if(createdDate < DateTime.Today.AddYears(-100)) createdDate = DateTime.Today;
            return createdDate; } set { createdDate = value; } }

        public virtual string FriendlyName { get; set; }

    }
}
